package me.itsoo.artemis.framework.ioc.exception;

import me.itsoo.artemis.framework.core.util.StringUtils;

/**
 * CreateBeanException
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/6/2
 */
public class CreateBeanException extends RuntimeException {

    private static final long serialVersionUID = -9046794281980385204L;

    private final String errorMsg;

    public CreateBeanException(Class<?> beanClass) {
        this.errorMsg = StringUtils.format("Failed to create bean, type of '{}'", beanClass.getCanonicalName());
    }

    @Override
    public String getMessage() {
        return errorMsg;
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}
